home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
v10n06.arc
/
LEAPTEST.PRG
< prev
next >
Wrap
Text File
|
1991-03-06
|
619b
|
29 lines
* LEAPTST.PRG, by Robert C. Ashcraft
* Demonstrates use of ISLEAP() Function
* Clipper 5.0 and Clipper Summer 87 tested.
CLEAR
? "Enter a YEAR (Between 100 - 2999) ..."
? "(Press ENTER alone to Exit)"
?
DO WHILE .T.
ACCEPT "> " TO mt
IF EMPTY(mt)
RETURN
ENDIF
IF VAL(mt)>99 .AND. VAL(mt)<3000
?? ">",mt,"is" + ;
IIF(IsLeap(CTOD("01/01/"+mt)),""," NOT"),"a Leap Year."
ENDIF
ENDDO
*
* FUNCTION IsLeap(date)
* Return .T. if date is in a leap year, .F. if not
*
FUNCTION IsLeap
PARAMETERS md
RETURN !EMPTY(CTOD("02/29/"+ALLTRIM(STR(YEAR(md)))))
* EOF